Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix: makes skin tone picker more accessible #283

Merged
merged 1 commit into from
Mar 12, 2019

Conversation

nolanlawson
Copy link

fixes #220

I still think this solution leaves a lot to be desired, but this is the best I could do for now while maintaining the existing design. I believe we should probably separate out the button that expands the menu and the buttons inside the menu, but this is a start.

  1. I made all <span>s into role="button". (It was too difficult to make them true <button>s, but I would love a PR in the future to do that. ) 🙂 Because they aren't true buttons, we have to handle tabindex and keydown (enter/spacebar) ourselves.
  2. I added aria-haspopup and aria-expanded to indicate when the menu button is opened.
  3. I added a <section> with aria-label set to the i18n.skintext (default: 'Choose your default skin tone') so that it's easier to tell what this mass of <button>s is there for
  4. I added aria-pressed states for when the skintone is selected/unselected to show that it's a toggle button
  5. I added some text for each skintone button, via both aria-label and title so that you can hover to see them. This necessitated some new i18n defaults.

This is definitely not where I would like it to be long-term, but at the very least you can now tab to the button, press spacebar/enter to expand, and then tab through the expanded buttons and press spacebar/enter to expand those.

nolanlawson added a commit to nolanlawson/emoji-mart that referenced this pull request Mar 10, 2019
fix: makes skin tone picker more accessible
nolanlawson added a commit to nolanlawson/emoji-mart that referenced this pull request Mar 10, 2019
fix: makes skin tone picker more accessible
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

A11Y: Skin Tone Picker should be accessible
1 participant